package com.xingzhi.util;

import java.io.*;

public class FileUtils {

    public static void copyFile(String inputPath, String outputPath) {
        try {
            InputStream inputStream = new FileInputStream(inputPath);
            OutputStream outputStream = new FileOutputStream(outputPath);
            byte[] buffer = new byte[1024];
            int length;
            // 读取数据并写入到目标文件
            while ((length = inputStream.read(buffer)) > 0) {
                outputStream.write(buffer, 0, length);
            }
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

}
